package com.fable.sp.core.domain;

import com.fable.sp.core.enums.ColumnType;

import java.io.Serializable;

/**
 * .
 *
 * @author stormning on 16/8/12.
 */
public class ColumnDef implements Serializable {

    private String name;

    private ColumnType columnType;

    private int length;

    private boolean unique = false;

    private boolean required = false;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public ColumnType getColumnType() {
        return columnType;
    }

    public void setColumnType(ColumnType columnType) {
        this.columnType = columnType;
    }

    public int getLength() {
        return length;
    }

    public void setLength(int length) {
        this.length = length;
    }

    public boolean isUnique() {
        return unique;
    }

    public void setUnique(boolean unique) {
        this.unique = unique;
    }

    public boolean isRequired() {
        return required;
    }

    public void setRequired(boolean required) {
        this.required = required;
    }

    public String getRealColumnName() {
        return "col_" + getName();
    }

}
